package inter

import (
	"showen7/inter"
	"showen7/num"
	"testing"
)

func TestVectorObject(t *testing.T) {
	// Test creating a vector with some elements
	elements := []inter.Object{
		&inter.NumberObject{Value: num.Integer(1)},
		&inter.NumberObject{Value: num.Integer(2)},
		&inter.StringObject{Value: "hello"},
	}

	vector := &inter.VectorObject{Elements: elements}

	// Test Type method
	if vector.Type() != inter.VECTOR_OBJ {
		t.Errorf("vector.Type() = %v, want %v", vector.Type(), inter.VECTOR_OBJ)
	}

	// Test Inspect method
	expected := "#(1 2 \"hello\")"
	if vector.Inspect() != expected {
		t.Errorf("vector.Inspect() = %v, want %v", vector.Inspect(), expected)
	}

	// Test empty vector
	emptyVector := &inter.VectorObject{Elements: []inter.Object{}}
	expectedEmpty := "#()"
	if emptyVector.Inspect() != expectedEmpty {
		t.Errorf("emptyVector.Inspect() = %v, want %v", emptyVector.Inspect(), expectedEmpty)
	}
}
